import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
import HomeView from '../views/layout/HomeView.vue'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    redirect: '/financial_home',
    children: [
      {
        path: '/financial_home',
        name: 'financial_home',
        component: () => import(/* webpackChunkName: "home_info" */ '../views/home/HomeInfoView.vue')
      },
      {
        path: '/evaluation_index',
        name: 'evaluation_index',
        component: () => import(/* webpackChunkName: "evaluation"*/ '../views/evaluation_index/evaluationView.vue')
      },
      {
        path: '/evaluation_indexA',
        name: 'evaluation_indexA',
        component: () => import(/* webpackChunkName: "evaluation"*/ '../views/evaluation_index/indexView/indexViewA.vue'),
      },
      {
        path: '/evaluation_indexB',
        name: 'evaluation_indexB',
        component: () => import(/* webpackChunkName: "evaluation"*/ '../views/evaluation_index/indexView/indexViewB.vue'),
      },
      {
        path: '/evaluation_indexC',
        name: 'evaluation_indexC',
        component: () => import(/* webpackChunkName: "evaluation"*/ '../views/evaluation_index/indexView/indexViewC.vue'),
      },
      {
        path: '/evaluation_indexD',
        name: 'evaluation_indexD',
        component: () => import(/* webpackChunkName: "evaluation"*/ '../views/evaluation_index/indexView/indexViewD.vue'),
      },
      {
        path: '/algorithm_intro',
        name: 'algorithm_intro',
        component: () => import(/* webpackChunkName: "evaluation"*/ '../views/algorithm_intro/alIntroView.vue')
      },
      {
        path: '/credit_risks',
        name: 'credit_risks',
        component: () => import(/* webpackChunkName: "evaluation"*/ '../views/credit_risks/creditRisksView.vue')
      },
      {
        path: '/credit_result',
        name: 'credit_result',
        component: () => import(/* webpackChunkName: "evaluation"*/ '../views/credit_result/creditResultView.vue')
      },
    ]
  },
  // {
  //   path: '/about',
  //   name: 'about',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  // }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
